[#ftl]
[#assign entityName="Article"]
[#assign pathRoot="/admin/cms/article/article_"]
[@jsec.authPage perms=["${entityName}_ctrl"]/]
[@frame.root]
  <!-- Default panel contents -->
  [@frame.header]
  [@frame.title]
  	编辑文章
  [/@]
  [/@]
[@frame.body]
  	[#global ent=(jdao.hql("from ${entityName} where id=?",[jweb.pathName("id")])()[0])!{}]
    [@form.form  type="upload" id="ent" action="${base}${pathRoot}save.shtml" back="${base}${pathRoot}list.shtml" topbtn=true]
		[@form.text id="title" label="标题" length=6 required=true/]
		[@form.image id="headimg" label="标题图"/]
		[@form.select2 id="articleType.id" datas=jdao.hql("from ArticleType",[])() value="id" title="name" label="类型" length=3 required=true /]
		[@form.select2 id="pageBlock.id" datas=jdao.hql("from PageBlock",[])() value="id" title="name" label="板块" length=3 required=true /]
		[@form.select2 id="pageChannel.id" datas=jdao.hql("from PageChannel",[])() value="id" title="name" label="栏目" length=3 required=true /]
		[@form.field id="id" label="状态设置" length=3 ;item]
			<label>
		      <input id="top" type="checkbox" [#if (ent.top)??&&ent.top]checked="checked" [/#if] class="check_item"><input name="top" type="hidden" value="false"/> 置顶
		    </label>
			<label>
		      <input id="hot" type="checkbox" class="check_item" [#if (ent.hot)??&&ent.hot]checked="checked" [/#if]><input name="hot" type="hidden" value="false"/>热点
		    </label>
		    <script type="text/javascript">
		    	(function(){
		    		$(".check_item").click(function(){
		    			$("input[name='"+$(this).attr("id")+"']").val($(this).is(":checked"));
		    		});
		    	})();
		    </script>
		[/@]
		[@form.editor id="summary" label="摘要" length=6/]
		[@form.editor id="body" label="正文" length=8 richtext=true/]
	[/@]
[/@]

[/@]
